config BR2_PACKAGE_KODI_ARCH_SUPPORTS
	bool
	default y if (BR2_arm || (BR2_mipsel && BR2_TOOLCHAIN_USES_GLIBC) || BR2_i386 || BR2_x86_64) && BR2_PACKAGE_BOOST_ARCH_SUPPORTS

comment "kodi needs a toolchain w/ C++, threads, wchar, dynamic library"
	depends on BR2_PACKAGE_KODI_ARCH_SUPPORTS
	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS \
		|| !BR2_USE_WCHAR || BR2_STATIC_LIBS
	depends on BR2_USE_MMU

config BR2_PACKAGE_KODI_EGL_GLES
	bool
	default y
	depends on BR2_PACKAGE_HAS_LIBEGL
	depends on BR2_PACKAGE_HAS_LIBGLES
	depends on !BR2_PACKAGE_KODI_GL # prefer GL if available

config BR2_PACKAGE_KODI_GL
	bool
	default y
	depends on BR2_PACKAGE_HAS_LIBGL
	depends on !BR2_arm # kodi needs egl/gles on arm

comment "kodi needs an OpenGL or an openGL ES and EGL backend"
	depends on BR2_i386 || BR2_x86_64
	depends on !BR2_PACKAGE_KODI_GL && !BR2_PACKAGE_KODI_EGL_GLES

comment "kodi requires an OpenGL ES and EGL backend"
	depends on BR2_arm
	depends on !BR2_PACKAGE_KODI_EGL_GLES

menuconfig BR2_PACKAGE_KODI
	bool "kodi"
	select BR2_NEEDS_HOST_JAVA
	select BR2_PACKAGE_BOOST
	select BR2_PACKAGE_BOOST_THREAD
	select BR2_PACKAGE_BZIP2
	select BR2_PACKAGE_EXPAT
	select BR2_PACKAGE_FFMPEG
	select BR2_PACKAGE_FFMPEG_GPL
	select BR2_PACKAGE_FFMPEG_POSTPROC # postproc depends on GPL
	select BR2_PACKAGE_FFMPEG_SWSCALE
	select BR2_PACKAGE_FONTCONFIG
	select BR2_PACKAGE_FREETYPE
	select BR2_PACKAGE_JASPER
	select BR2_PACKAGE_JPEG
	select BR2_PACKAGE_LIBASS
	select BR2_PACKAGE_LIBCDIO
	select BR2_PACKAGE_LIBCURL
	select BR2_PACKAGE_LIBFRIBIDI
	select BR2_PACKAGE_LIBGLEW if BR2_PACKAGE_KODI_GL
	select BR2_PACKAGE_LIBGLU if BR2_PACKAGE_KODI_GL
	select BR2_PACKAGE_LIBGCRYPT
	select BR2_PACKAGE_LIBMPEG2
	select BR2_PACKAGE_LIBOGG
	select BR2_PACKAGE_LIBPLIST
	select BR2_PACKAGE_LIBPNG
	select BR2_PACKAGE_LIBSAMPLERATE
	select BR2_PACKAGE_LIBSQUISH
	select BR2_PACKAGE_LIBVORBIS
	select BR2_PACKAGE_LIBXML2
	select BR2_PACKAGE_LIBXSLT
	select BR2_PACKAGE_LZO
	select BR2_PACKAGE_NCURSES
	select BR2_PACKAGE_OPENSSL
	select BR2_PACKAGE_PCRE
	select BR2_PACKAGE_PCRE_UCP
	select BR2_PACKAGE_PYTHON
	select BR2_PACKAGE_PYTHON_BSDDB
	select BR2_PACKAGE_PYTHON_BZIP2
	select BR2_PACKAGE_PYTHON_CURSES
	select BR2_PACKAGE_PYTHON_PYEXPAT
	select BR2_PACKAGE_PYTHON_READLINE
	select BR2_PACKAGE_PYTHON_SQLITE
	select BR2_PACKAGE_PYTHON_SSL
	select BR2_PACKAGE_PYTHON_UNICODEDATA
	select BR2_PACKAGE_PYTHON_ZLIB
	select BR2_PACKAGE_READLINE
	select BR2_PACKAGE_SQLITE
	select BR2_PACKAGE_TAGLIB
	select BR2_PACKAGE_TIFF
	select BR2_PACKAGE_TINYXML
	select BR2_PACKAGE_LIBDRM if BR2_PACKAGE_KODI_GL
	select BR2_PACKAGE_XLIB_XMU if BR2_PACKAGE_KODI_GL # needed by rsxs screensaver
	select BR2_PACKAGE_XLIB_XRANDR if BR2_PACKAGE_KODI_GL
	select BR2_PACKAGE_XLIB_XT if BR2_PACKAGE_KODI_GL # needed by rsxs screensaver
	select BR2_PACKAGE_YAJL
	select BR2_PACKAGE_ZLIB
	select BR2_TOOLCHAIN_GLIBC_GCONV_LIBS_COPY if BR2_TOOLCHAIN_USES_GLIBC # runtime UTF conversion support
	depends on BR2_INSTALL_LIBSTDCPP
	depends on BR2_TOOLCHAIN_HAS_THREADS
	depends on BR2_PACKAGE_KODI_EGL_GLES || BR2_PACKAGE_KODI_GL
	depends on BR2_USE_MMU # python
	depends on BR2_USE_WCHAR
	depends on !BR2_STATIC_LIBS # python
	depends on BR2_PACKAGE_KODI_ARCH_SUPPORTS
	help
	  Kodi is an award-winning free and open source (GPL) software
	  media player and entertainment hub for digital media.

	  http://kodi.tv

if BR2_PACKAGE_KODI

source "package/kodi-platform/Config.in"

config BR2_PACKAGE_KODI_ALSA_LIB
	bool "alsa"
	select BR2_PACKAGE_ALSA_LIB
	help
	  Enable alsa support.

config BR2_PACKAGE_KODI_AVAHI
	bool "avahi"
	depends on !BR2_STATIC_LIBS # avahi
	select BR2_PACKAGE_AVAHI
	select BR2_PACKAGE_AVAHI_DAEMON
	help
	  Enable Avahi support.
	  Select this if you want Kodi to support Bonjour protocol.

config BR2_PACKAGE_KODI_DBUS
	bool "dbus"
	select BR2_PACKAGE_DBUS
	help
	  Enable D-Bus support

config BR2_PACKAGE_KODI_LIBBLURAY
	bool "blu-ray"
	select BR2_PACKAGE_LIBBLURAY
	depends on !BR2_STATIC_LIBS
	help
	  Enable Blu-ray input support.
	  Select this if you want to play back Blu-ray content.

comment "libbluray support needs a toolchain w/ dynamic library"
	depends on BR2_STATIC_LIBS

config BR2_PACKAGE_KODI_GOOM
	bool "goom screensaver"
	depends on BR2_PACKAGE_KODI_GL
	help
	  Enable goom screensaver

comment "goom needs an OpenGL backend"
	depends on !BR2_PACKAGE_KODI_GL

config BR2_PACKAGE_KODI_RSXS
	bool "rsxs screensaver"
	depends on BR2_PACKAGE_KODI_GL
	help
	  Enable goom screensaver

comment "rsxs needs an OpenGL backend"
	depends on !BR2_PACKAGE_KODI_GL

config BR2_PACKAGE_KODI_LIBCEC
	bool "hdmi cec"
	depends on !BR2_STATIC_LIBS # libcec
	depends on BR2_PACKAGE_HAS_UDEV
	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # libcec
	select BR2_PACKAGE_LIBCEC
	help
	  Enable CEC (Consumer Electronics Control) support.
	  Select this if you want Kodi to support HDMI CEC.

comment "hdmi cec support needs udev /dev management and a toolchain w/ dynamic library"
	depends on BR2_STATIC_LIBS || !BR2_PACKAGE_HAS_UDEV || \
		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_7

config BR2_PACKAGE_KODI_LIRC
	bool "lirc"
	help
	  Enable lirc support

config BR2_PACKAGE_KODI_LIBMICROHTTPD
	bool "web server"
	select BR2_PACKAGE_LIBMICROHTTPD
	help
	  Enable webserver feature

config BR2_PACKAGE_KODI_LIBNFS
	bool "nfs"
	depends on BR2_TOOLCHAIN_HAS_NATIVE_RPC
	select BR2_PACKAGE_LIBNFS
	help
	  Enable NFS server support.

comment "nfs support needs a toolchain w/ RPC support"
	depends on !BR2_TOOLCHAIN_HAS_NATIVE_RPC

config BR2_PACKAGE_KODI_RTMPDUMP
	bool "rtmp"
	select BR2_PACKAGE_RTMPDUMP
	help
	  Enable RTMP input support.
	  Select this if you want to play back rtmp stream.

config BR2_PACKAGE_KODI_LIBSHAIRPLAY
	bool "shairport"
	depends on !BR2_STATIC_LIBS # libshairplay -> avahi
	select BR2_PACKAGE_LIBSHAIRPLAY
	help
	  Enable Shairport support.
	  Select this if you want to stream content from an Apple device.

comment "shairport support needs a toolchain w/ dynamic library"
	depends on BR2_STATIC_LIBS

comment "samba support needs an (e)glibc toolchain"
	depends on !BR2_TOOLCHAIN_USES_GLIBC

config BR2_PACKAGE_KODI_LIBSMBCLIENT
	bool "samba"
	depends on BR2_TOOLCHAIN_USES_GLIBC
	select BR2_PACKAGE_SAMBA4
	help
	  Enable Samba support

config BR2_PACKAGE_KODI_LIBTHEORA
	bool "theora"
	select BR2_PACKAGE_LIBTHEORA
	help
	  Enable Theora input support.
	  Select this if you want to play back OGG/OGV files (Video).

config BR2_PACKAGE_KODI_LIBUSB
	bool "usb"
	select BR2_PACKAGE_LIBUSB
	select BR2_PACKAGE_LIBUSB_COMPAT
	help
	  Enable libusb support.

config BR2_PACKAGE_KODI_LIBVA
	bool "va"
	select BR2_PACKAGE_LIBVA
	depends on !BR2_STATIC_LIBS
	help
	  Enable libva support.

comment "libva support needs toolchain w/ dynamic library"
	depends on BR2_STATIC_LIBS

config BR2_PACKAGE_KODI_WAVPACK
	bool "wavpack"
	select BR2_PACKAGE_WAVPACK
	help
	  Enable WAV input support.
	  Select this if you want to play back WV files.

config BR2_PACKAGE_KODI_OPTICALDRIVE
	bool

menu "Audio decoder addons"
	source "package/kodi-audiodecoder-modplug/Config.in"
	source "package/kodi-audiodecoder-nosefart/Config.in"
	source "package/kodi-audiodecoder-sidplay/Config.in"
	source "package/kodi-audiodecoder-snesapu/Config.in"
	source "package/kodi-audiodecoder-stsound/Config.in"
	source "package/kodi-audiodecoder-timidity/Config.in"
	source "package/kodi-audiodecoder-vgmstream/Config.in"
endmenu

menu "Audio encoder addons"
	source "package/kodi-audioencoder-flac/Config.in"
	source "package/kodi-audioencoder-lame/Config.in"
	source "package/kodi-audioencoder-vorbis/Config.in"
	source "package/kodi-audioencoder-wav/Config.in"
endmenu

menu "PVR addons"
	source "package/kodi-addon-xvdr/Config.in"
	source "package/kodi-pvr-argustv/Config.in"
	source "package/kodi-pvr-dvblink/Config.in"
	source "package/kodi-pvr-dvbviewer/Config.in"
	source "package/kodi-pvr-filmon/Config.in"
	source "package/kodi-pvr-hts/Config.in"
	source "package/kodi-pvr-iptvsimple/Config.in"
	source "package/kodi-pvr-mediaportal-tvserver/Config.in"
	source "package/kodi-pvr-mythtv/Config.in"
	source "package/kodi-pvr-nextpvr/Config.in"
	source "package/kodi-pvr-njoy/Config.in"
	source "package/kodi-pvr-pctv/Config.in"
	source "package/kodi-pvr-stalker/Config.in"
	source "package/kodi-pvr-vbox/Config.in"
	source "package/kodi-pvr-vdr-vnsi/Config.in"
	source "package/kodi-pvr-vuplus/Config.in"
	source "package/kodi-pvr-wmc/Config.in"
endmenu

menu "Screensavers"
	source "package/kodi-screensaver-asteroids/Config.in"
	source "package/kodi-screensaver-biogenesis/Config.in"
	source "package/kodi-screensaver-crystalmorph/Config.in"
	source "package/kodi-screensaver-greynetic/Config.in"
	source "package/kodi-screensaver-pingpong/Config.in"
	source "package/kodi-screensaver-pyro/Config.in"
	source "package/kodi-screensaver-stars/Config.in"
endmenu

menu "Visualisations"
	source "package/kodi-visualisation-shadertoy/Config.in"
	source "package/kodi-visualisation-spectrum/Config.in"
	source "package/kodi-visualisation-waveforhue/Config.in"
	source "package/kodi-visualisation-waveform/Config.in"
endmenu

endif # BR2_PACKAGE_KODI
